package com.sjsu.aws.doublebarrier;

/**
 * 
 * @author Deepali Pawar
 * 
 */
public class DoubleBarrier {
	
	private String	uuid;
	private String	barrierId;
	private String	participantId;
	private String	jobId;
	private long	endTimestamp;
	
	public String getBarrierId() {
		return this.barrierId;
	}
	
	public void setBarrierId(String barrierId) {
		this.barrierId = barrierId;
	}
	
	public String getParticipantId() {
		return this.participantId;
	}
	
	public void setParticipantId(String participantId) {
		this.participantId = participantId;
	}
	
	public String getJobId() {
		return this.jobId;
	}
	
	public void setJobId(String jobId) {
		this.jobId = jobId;
	}
	
	public long getEndTimestamp() {
		return this.endTimestamp;
	}
	
	public void setEndTimestamp(long endTimestamp) {
		this.endTimestamp = endTimestamp;
	}
	
	public String getUuid() {
		return uuid;
	}
	
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
		        + ((this.barrierId == null) ? 0 : this.barrierId.hashCode());
		result = prime * result
		        + (int) (this.endTimestamp ^ (this.endTimestamp >>> 32));
		result = prime * result
		        + ((this.jobId == null) ? 0 : this.jobId.hashCode());
		result = prime
		        * result
		        + ((this.participantId == null) ? 0 : this.participantId
		                .hashCode());
		result = prime * result
		        + ((this.uuid == null) ? 0 : this.uuid.hashCode());
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DoubleBarrier other = (DoubleBarrier) obj;
		if (this.barrierId == null) {
			if (other.barrierId != null)
				return false;
		} else if (!this.barrierId.equals(other.barrierId))
			return false;
		if (this.endTimestamp != other.endTimestamp)
			return false;
		if (this.jobId == null) {
			if (other.jobId != null)
				return false;
		} else if (!this.jobId.equals(other.jobId))
			return false;
		if (this.participantId == null) {
			if (other.participantId != null)
				return false;
		} else if (!this.participantId.equals(other.participantId))
			return false;
		if (this.uuid == null) {
			if (other.uuid != null)
				return false;
		} else if (!this.uuid.equals(other.uuid))
			return false;
		return true;
	}
}
